import * as http from '@api/http'

/**
 * @purpose 获取短信验证码
 * @param mobile
 * @returns {PromiseLike<T> | Promise<T> | *}
 */
export function authCode (mobile) {
  return http
    .get('sms.authCode', {
      mobile: mobile
    })
    .then(r => r.data)
}

/**
 * @purpose 获取更换手机号码时的验证码
 * @param mobile
 * @returns {PromiseLike<T> | Promise<T> | *}
 */
export function authCodeForChangeMobile (mobile) {
  return http
    .get('sms.authCodeForChangeMobile', {
      mobile: mobile
    })
    .then(r => r.data)
}
